<!DOCTYPE html>

<html>

<head>
    <meta charset="utf-8">
    <title>后台管理模板</title>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <meta name="apple-mobile-web-app-status-bar-style" content="black">
    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="format-detection" content="telephone=no">
    <link rel="stylesheet" href="/static/plugins/layui/css/layui.css" media="all" />
    <link rel="stylesheet" href="/static/css/global.css" media="all">
    <script type="text/javascript" src="/static/js/web/jquery-1.11.0.js"></script>
    <script type="text/javascript" src="/static/js/updatemsg.js"></script>
    <link rel="stylesheet" href="/static/plugins/font-awesome/css/font-awesome.min.css">
    <style>
        .bicthmomo{
            display: -webkit-inline-box;
            background: #5eb95e;
            height: 20px;
            line-height: 1.5;
            width: 20px;
            text-align: -webkit-center;
            border-radius: 10px;
            color: white;
        }
    </style>
</head>

<body>
<div class="layui-layout layui-layout-admin" style="border-bottom: solid 5px #1aa094;">
    <div class="layui-header header header-demo">
        <div class="layui-main">
            <div class="admin-login-box">
                <a class="logo" style="left: 0;" href="/admin/index/index">
                    <span style="font-size: 22px;">众博</span>
                </a>
                <div class="admin-side-toggle">
                    <i class="fa fa-bars" aria-hidden="true"></i>
                </div>
                <div class="admin-side-full">
                    <i class="fa fa-life-bouy" aria-hidden="true"></i>
                </div>
            </div>
            <ul class="layui-nav admin-header-item">
                <!--<li class="layui-nav-item">-->
                    <!--<a href="javascript:;">清除缓存</a>-->
                <!--</li>-->
                <!--<li class="layui-nav-item" id="pay">-->
                    <!--<a href="javascript:;">捐赠我</a>-->
                <!--</li>-->
                <!--<li class="layui-nav-item">-->
                    <!--<a href="javascript:;">浏览网站</a>-->
                <!--</li>-->
                <!--<li class="layui-nav-item" id="video1">-->
                    <!--<a href="javascript:;">视频</a>-->
                <!--</li>-->
                <li class="layui-nav-item">
                    <a href="javascript:;" class="admin-header-user">
                        <img src="/static/images/0.jpg" />
                        <input type="hidden" id="mp3d" value="{$data}"/>
                        <i class="bicthmomo" id="mp3c">{$data}</i>
                        <span>{$username}</span>
                    </a>
                    <dl class="layui-nav-child">
                        <!--<dd>-->
                            <!--<a href="javascript:;"><i class="fa fa-user-circle" aria-hidden="true"></i> 个人信息</a>-->
                        <!--</dd>-->
                        <!--<dd>-->
                            <!--<a href="javascript:;"><i class="fa fa-gear" aria-hidden="true"></i> 设置</a>-->
                        <!--</dd>-->
                            <dd class="editPassword">
                                <a href="javascript:;"><i class="fa fa-lock" aria-hidden="true" style="padding-right: 3px;padding-left: 1px;"></i> 修改密码</a>
                            </dd>
                        <!--<dd id="lock">-->
                            <!--<a href="javascript:;">-->
                                <!--<i class="fa fa-lock" aria-hidden="true" style="padding-right: 3px;padding-left: 1px;"></i> 锁屏 (Alt+L)-->
                            <!--</a>-->
                        <!--</dd>-->
                        <dd class="lop">
                            <a href="#" id="out"><i class="fa fa-sign-out" aria-hidden="true"></i> 退出</a>
                        </dd>
                    </dl>
                </li>
            </ul>
            <ul class="layui-nav admin-header-item-mobile">
                <li class="layui-nav-item">
                    <a href="login.html"><i class="fa fa-sign-out" aria-hidden="true"></i>退出</a>
                </li>
            </ul>
        </div>
    </div>
    <div class="layui-side layui-bg-black" id="admin-side">
        <div class="layui-side-scroll" id="admin-navbar-side" lay-filter="side"></div>
    </div>
    <div class="layui-body" style="bottom: 0;border-left: solid 2px #1AA094;" id="admin-body">
        <div class="layui-tab admin-nav-card layui-tab-brief" lay-filter="admin-tab">
            <ul class="layui-tab-title">
                <li class="layui-this">
                    <i class="fa fa-dashboard" aria-hidden="true"></i>
                    <cite>控制面板</cite>
                </li>
            </ul>
            <div class="layui-tab-content" style="min-height: 150px; padding: 5px 0 0 0;">
                <div class="layui-tab-item layui-show">
                    <iframe src="/admin/problem/index" id="fort"></iframe>
                </div>
            </div>
        </div>
    </div>
    <div class="layui-footer footer footer-demo" id="admin-footer">
        <div class="layui-main">

        </div>
    </div>
    <div class="site-tree-mobile layui-hide">
        <i class="layui-icon">&#xe602;</i>
    </div>
    <div class="site-mobile-shade"></div>

    <!--锁屏模板 start-->
    <script type="text/template" id="lock-temp">
        <div class="admin-header-lock" id="lock-box">
            <div class="admin-header-lock-img">
                <img src="/static/images/0.jpg"/>
            </div>
            <div class="admin-header-lock-name" id="lockUserName">beginner</div>
            <input type="text" class="admin-header-lock-input" value="输入密码解锁.." name="lockPwd" id="lockPwd" />
            <button class="layui-btn layui-btn-small" id="unlock">解锁</button>
        </div>
    </script>
    <!--锁屏模板 end -->

    <script type="text/javascript" src="/static/plugins/layui/layui.js"></script>
    <script type="text/javascript" src="/static/datas/nav.js"></script>
    <script src="/static/js/index.js"></script>
    <script>
        $(function(){
            $(".bicthmomo").click(function(){
                $("#fort").attr("src",'/admin/problem/index');
            });
        });
        layui.use('layer', function() {
            var $ = layui.jquery,
                layer = layui.layer;

            $('#video1').on('click', function() {
                layer.open({
                    title: 'YouTube',
                    maxmin: true,
                    type: 2,
                    content: 'video.html',
                    area: ['800px', '500px']
                });
            });
            $('#pay').on('click', function () {
                layer.open({
                    title: false,
                    type: 1,
                    content: '<img src="/static/images/xx.png" />',
                    area: ['500px', '250px'],
                    shadeClose: true
                });
            });
        });
        $(function(){
            $('.lop').click(function(){
                layer.confirm('是否退出？', {
                    btn: ['确定','取消'] //按钮
                }, function(){
                    $.ajax({
                        type:'post',
                        datatype:'json',
                        url:'/admin/inout/adminOut',
                        data:{

                        },
                        success:function(res){
                            if(res.status==0){
                                layer.msg(res.msg);
                                setTimeout('location.href="/admin/inout/login"',1000);
                            }else{
                                layer.msg(res.msg);
                            }
                        }
                    });
                }, function(){

                });
            });
        });
        layui.config({
            base: '/static/js/',
            v: new Date().getTime()
        }).use(['layer','form'], function () {
            $('.editPassword').on('click', function (){
                var cons = '<div style="padding:10px;">'+
                        '<input type="password" class="layui-input" style="margin-bottom:5px;" id="password" placeholder="新密码" /><input type="password" class="layui-input" style="margin-bottom: 5px;" id="newpassword" placeholder="确认密码"/></div>';
                layer.open({
                    type: 1,
                    title: '修改密码',
                    content: cons,
                    btn: ['确定', '取消'],
                    area: ['350px', '200px'],
                    yes: function (index, layero) {
                        //这是核心的代码。
                        var password = $("#password").val();
                        var newpassword = $("#newpassword").val();
                        if(password==''){
                            layer.msg("密码不能为空");
                            return false;
                        }
                        if(newpassword==""){
                            layer.msg("请确认密码");
                            return false;
                        }
                        if(password!=newpassword){
                            layer.msg("密码不一致");
                            return false;
                        }
                        $.ajax({
                            type:"post",
                            dataType: "json",
                            url: "/admin/index/edit",
                            data:{
                                password:password,
                                newpassword:newpassword
                            },
                            success:function(res){
                                if(res.status==0){
                                    layer.msg(res.msg);
                                    setTimeout('location.href="/admin/index/index"',1000);
                                }else{
                                    layer.msg(res.msg);
                                }
                            }
                        });

                    },
                    maxmin: true
                });
            });
        })
    </script>
</div>
</body>
</html>